{% extends "base.html" %}
{% load i18n %}

{% block head_extra %}
{% block form_media %}{{ form.media }}{% endblock %}
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  $("#id_new_password1").focus();
});
</script>
{% endblock head_extra %}

{% block title %}{% trans "Password reset" %}{% endblock %}

{% block content %}
{% if validlink %}
<h1>{% trans "Password reset" %}</h1>

<p class="hint">{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>

{% for key, error in form.errors.iteritems %}
{% ifequal key "__all__" %}<p class="error">{{ error.0 }}</p>{% endifequal %}
{% endfor %}

<form id="id_form" method="post" action="">
{% for field in form %}
<p>
<label for="id_{{ field.name }}">{{ field.label }}:</label>
{{ field }}
<span id="error_{{ field.name }}" class="error">{{ field.errors.0 }}</span>
</p>
{% endfor %}
<p>
<input type="submit" id="id_submit" name="submit" value="Change my password" />
</p>
</form>
{% else %}
<h1>{% trans "Password reset unsuccessful" %}</h1>

<p class="error">{% trans "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}</p>
{% endif %}
{% endblock content %}
